import pandas as pd
from utils import reader

df1 = reader.readhour('swap',['Copp'])  # 这里需要填一个我们在选币数据整理时跑过的因子
df1['ret_next'] = df1['下个周期_avg_price'] / df1['avg_price'] -1
df1 = df1[['candle_begin_time','symbol','ret_next']]

#读入数据
df = pd.read_csv('../../output/select.csv',parse_dates=['candle_begin_time'])
df = pd.merge(df,df1,right_on=['candle_begin_time','symbol'],left_on=['candle_begin_time','symbol'])
df['offset'] = 0
df.to_csv('../data/input/select.csv',encoding='gbk')